package com.example.service.adapter

import android.widget.ImageView
import android.widget.TextView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.service.R
import com.example.service.entity.ServiceUIEntity

class ServiceUIAdapter:BaseQuickAdapter<ServiceUIEntity,BaseViewHolder>(R.layout.item_service_ui) {
    override fun convert(holder: BaseViewHolder, item: ServiceUIEntity) {
        holder.getView<TextView>(R.id.service_name).text=item.name
        Glide.with(context)
            .load(item.icon)
            .skipMemoryCache(true) // 跳过内存缓存
            .diskCacheStrategy(DiskCacheStrategy.NONE) // 跳过磁盘缓存
            .into(holder.getView<ImageView>(R.id.service_icon))
    }
}